home *** CD-ROM | disk | FTP | other *** search
- VERSION 4.00
- Begin VB.Form JSample
- Appearance = 0 'Flat
- BackColor = &H00C0C0C0&
- Caption = "Joystick Sample"
- ClientHeight = 5070
- ClientLeft = 1515
- ClientTop = 1755
- ClientWidth = 8175
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 700
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- ForeColor = &H80000008&
- Height = 5475
- Left = 1455
- LinkTopic = "Form1"
- ScaleHeight = 5070
- ScaleWidth = 8175
- Top = 1410
- Width = 8295
- Begin VB.Timer Timer1
- Interval = 1000
- Left = 7560
- Top = 3120
- End
- Begin VB.CommandButton Command1
- Appearance = 0 'Flat
- BackColor = &H80000005&
- Caption = "Capture Joystick"
- Height = 315
- Left = 2580
- TabIndex = 3
- Top = 1920
- Width = 1785
- End
- Begin JoystkLib.Joystk Joystick1
- Left = 3240
- Top = 120
- _Version = 131072
- _ExtentX = 847
- _ExtentY = 847
- _StockProps = 64
- Threshold = 10
- End
- Begin VB.Label Label6
- Appearance = 0 'Flat
- BackColor = &H80000005&
- BackStyle = 0 'Transparent
- Caption = $"JOYSTK1.frx":0000
- ForeColor = &H80000008&
- Height = 915
- Left = 210
- TabIndex = 8
- Top = 4020
- Width = 7785
- End
- Begin VB.Label Label5
- Appearance = 0 'Flat
- BackColor = &H80000005&
- BackStyle = 0 'Transparent
- Caption = "Joystick_ButtonUp( Button As Integer )"
- ForeColor = &H80000008&
- Height = 285
- Left = 480
- TabIndex = 7
- Top = 3600
- Width = 6675
- End
- Begin VB.Label Label4
- Appearance = 0 'Flat
- BackColor = &H80000005&
- BackStyle = 0 'Transparent
- Caption = "Joystick_ButtonDown( Button As Integer )"
- ForeColor = &H80000008&
- Height = 285
- Left = 480
- TabIndex = 6
- Top = 3180
- Width = 6585
- End
- Begin VB.Label Label2
- Appearance = 0 'Flat
- BackColor = &H80000005&
- BackStyle = 0 'Transparent
- Caption = "Joystick_Move( X As Integer, Y As Integer, Z As Integer)"
- ForeColor = &H80000008&
- Height = 285
- Left = 480
- TabIndex = 5
- Top = 2760
- Width = 6555
- End
- Begin VB.Label Label1
- Appearance = 0 'Flat
- BackColor = &H80000005&
- BackStyle = 0 'Transparent
- Caption = "Once the joystick has been captured, there are three events that may be generated:"
- ForeColor = &H80000008&
- Height = 285
- Index = 2
- Left = 240
- TabIndex = 4
- Top = 2340
- Width = 7755
- End
- Begin VB.Label Label1
- Appearance = 0 'Flat
- BackColor = &H80000005&
- BackStyle = 0 'Transparent
- Caption = $"JOYSTK1.frx":0140
- ForeColor = &H80000008&
- Height = 495
- Index = 1
- Left = 210
- TabIndex = 2
- Top = 1350
- Width = 7815
- End
- Begin VB.Label Label1
- Appearance = 0 'Flat
- BackColor = &H80000005&
- BackStyle = 0 'Transparent
- Caption = $"JOYSTK1.frx":01F7
- ForeColor = &H80000008&
- Height = 495
- Index = 0
- Left = 210
- TabIndex = 1
- Top = 720
- Width = 7785
- End
- Begin VB.Label Label3
- Appearance = 0 'Flat
- BackColor = &H80000005&
- BackStyle = 0 'Transparent
- Caption = "Joystick Control"
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 700
- size = 18
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- ForeColor = &H80000008&
- Height = 495
- Left = 240
- TabIndex = 0
- Top = 150
- Width = 2925
- End
- Attribute VB_Name = "JSample"
- Attribute VB_Creatable = False
- Attribute VB_Exposed = False
- Private Sub Command1_Click()
- Joystick1.Enabled = Not Joystick1.Enabled
- If (Joystick1.Enabled) Then
- Command1.Caption = "Release Joystick"
- Else
- Command1.Caption = "Capture Joystick"
- End If
- End Sub
- Private Sub Form_Load()
- JSample.Top = (Screen.Height - JSample.Height) / 2
- JSample.Left = (Screen.Width - JSample.Width) / 2
- End Sub
- Private Sub Joystick1_ButtonDown(ByVal button As Integer)
- Label4.Caption = "Joystick_ButtonDown(" & Str(button) & " )"
- Label4.ForeColor = RGB(255, 0, 0)
- End Sub
- Private Sub Joystick1_ButtonUp(ByVal button As Integer)
- Label5.Caption = "Joystick_ButtonUp(" & Str(button) & " )"
- Label5.ForeColor = RGB(255, 0, 0)
- End Sub
- Private Sub Joystick1_Move(ByVal x As Long, ByVal y As Long, ByVal z As Long)
- Label2.Caption = "Joystick1_Move(" & Str(x) & "," & Str(y) & "," & Str(z) & ")"
- End Sub
- Private Sub Timer1_Timer()
- Label4.ForeColor = 0
- Label5.ForeColor = 0
- End Sub
-